package framework.apache.common.codec.md5;
import java.io.UnsupportedEncodingException;

import org.apache.commons.codec.digest.DigestUtils;
public class Md5Demo {
	public static void main(String[] args) {
		System.out.println(MD5Test("123"));
	}
	private static String MD5Test(String str) {
		try {
			System.out.println("MD5 编码后：" + new String(DigestUtils.md5Hex(str.getBytes("UTF-8"))));
			System.out.println(new String(DigestUtils.md5(str.getBytes("UTF-8"))));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return str;
	}
}
